<extend name="Public/common"/>
<block name="othercss"> 

</block>
<block name="header">
</block>
<block name="body">
<div class="header">
    <div class="clearfix box">
        <!--<a class="save">保存</a>-->
        <a class="return" href="javascript:history.go(-1)"><i class="return-icon"></i></a>
        <h2 style="font-weight: normal">{$cat_name}</h2>
    </div>
</div>
<!--end header-->
<div class="container pt50">
    <ul class="pro-nav clearfix">
        <li  <if condition="empty($curr_order)">class="on"</if>>
            <a href="{$order_list['0']['url']}">综合</a>
        </li>
        <li <if condition="$curr_order eq 'price_asc'">class="on1"<elseif condition="$curr_order eq 'price_desc'" />class="on"<else/></if>>
            <a href="<if condition="$curr_order eq 'price_asc'">{$order_list['2']['url']}<elseif condition="$curr_order eq 'price_desc'" />{$order_list['0']['url']} <else />{$order_list['3']['url']}</if>">价格</a>
        </li>
        <li <if condition="$curr_order eq 'time_desc'">class="on"</if>>
            <a href="{$order_list['6']['url']}">新品</a>
        </li>
        <li>
            <a id="select">筛选</a>
        </li>
    </ul>
    <!--产品container-->
    <ul class="index_list pro_list">
	<empty name="glist"><div style="margin-top:50px; text-align:center">暂无记录</div></empty>
	   <foreach name="glist" item="gitem">
        <li>
            <a href="{:U('Goods/index',array('id'=>$gitem['goods_id']))}">
                <img src="__ROOT__{$gitem.picture}" width="100%"/>
                <div class="ones">{$gitem.goods_name}</div>
                <div class="tags ones">
                    <span>{$gitem.cuxiao_msg}</span>
                   
                </div>
            </a>
            <div class="clearfix">
                <a href="car.html" class="car_icon">
                    <img src="{$theme_path}/images/i_icon13.png"/>
                </a>
                <a href="{:U('Goods/index',array('id'=>$gitem['goods_id']))}" class="price">￥{$gitem.price}</a>
            </div>
        </li>
		</foreach>
	

    </ul>
    <div class="bg-black"></div>
    <div class="select_content">
    <dl><dt><dd><div class="txt1">{:$search_select?$search_select:'所有商品'}</div></dd></dt></dl>
    
    
    <if condition="count($brand_list) gt 0">
        <dl>
            <dt>
                品牌
            </dt>
            <dd>
                <div class="s-sum">
                  
                     <foreach name="brand_list" item="brand_item">
                    <a <eq name="brand_item['brand_id']" value="$bid">class="on" </eq> href="{$brand_item.url}" id="brand_{$brand_item.brand_id}">{$brand_item.brand_name}</a>
                      </foreach>
                    
                </div>
            </dd>
        </dl>
        </if>
		 <if condition="count($cat_list) gt 0"> 
        <dl>
            <dt>
                分类
            </dt>
            <dd>
                <div class="s-sum">
				  <foreach name="cat_list" item="cat_item">
                  <a href="{$cat_item.url}" id="cat_{$cat_item.cat_id}">{$cat_item.cat_name}</a>
                  </foreach>

                </div>
            </dd>
        </dl>
		</if>
        <dl>
            <dt>价格区间</dt>
            <dd><input type="text" id="priceMin" maxlength="6"  onkeyup="this.value=this.value.replace(/[^0-9]/g,'');"  value="{$price_s[0]}"  class="s-price"/>-<input type="text" maxlength="8" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" value="{$price_s[1]}" id="priceMax" class="s-price"><input type="submit" value="确定" class="sub price_sub" /></dd>
        </dl>
        <div class="fix_bottom"><div class="select_close" id="close">关闭</div><div class="select_reset"><a href="{:urlrotue('GList/index')}">重置</a></div></div>
    </div>
</div>
</block>

<block name="otherjs">
<script>
    $('#select').click(function () {
        $('.bg-black').fadeIn();
        $('.select_content').fadeIn();
    })

    $('#close').click(function () {
        $('.bg-black').fadeOut();
        $('.select_content').fadeOut();
    })
	
		$(".price_sub").click(function () {
		             
                   var priceMin = $('#priceMin').val()
				   var priceMax = $('#priceMax').val()
				   if(priceMin==''){
				     priceMin=0
				    }
				   if(priceMax==''){
				   priceMax=1000
				   }
				   priceMin =  parseInt(priceMin);
				   priceMax = parseInt(priceMax);
				   if(priceMin>priceMax){
				    priceMax2 = priceMin
					priceMin2 = priceMax
					priceMin = priceMin2
					priceMax = priceMax2
				    }
					
		 var url = "{$current_url}";
		     url = url.replace(/.html/, "/price/"+priceMin+"-"+priceMax+".html"); 
	         window.location.href=url
  })


</script>
</block>